﻿@{
    ViewBag.Title = "Home Page";
}
@section HeadSection{
    <script type="text/javascript">
        var leopardIndex1 = 1, leopardIndex2 = 1;
        setTime();

        function setTime() {
            setTimeout(setTime, 100);
            setPosition(leopardIndex1, "leopard1");
            leopardIndex1 = leopardIndex1 == 8 ? 1 : leopardIndex1 + 1;
        }

        function setPosition(i, id) {
            $("#" + id).attr("class", "leopard" + i);
        }

        document.onkeydown = function () {
            switch (event.which) {
                case 39:
                    setPosition(leopardIndex2, "leopard2");
                    leopardIndex2 = leopardIndex2 == 8 ? 1 : leopardIndex2 + 1;
                    break;
            }
        }
    </script>
}
<h2>@ViewBag.Message</h2>
@*<p>
    To learn more about ASP.NET MVC visit <a href="http://asp.net/mvc" title="ASP.NET MVC Website">
        http://asp.net/mvc</a>.
</p>*@
<div class="leopardBlock">
    <div id="leopard1" class="leopard1">
    </div>
    <div id="leopard2" class="leopard1">
    </div>
</div>
